import pymysql
import csv
import random
import json
from util import insert_csv_to_db,generate_random_solver,query_nutrition_by_id
DISH_CLASS_NUM=15
IGNORE=0
NTRITION_TYPE=["DBZ","WA","WPP","XIN","ZF","WE","WC","XI","TL","WB1","AI","SSXW","NL","WB2","TIE","DC","DWXDB","DDDB","DWXZF","ZTNL","DWXWA"]
#                   DBZ,ZF,TL,      WA,   WB1,WB2,WC,WE,XIN,  XI, GAI,TIE
STANDARD_NUTRITION=[90,IGNORE,IGNORE,1000,1.5,1.3,60,10,15,   50, 800, 15]
# CLASS:[CLASS_NUM,DAY_REQUIRED_NUM]
RECIPE_MAP = {

    "D1": [10, 1],
    "D2": [3, 1],
    "D3": [50, 1],
    "D4": [52, 1],
    "D5": [2, 2],
    "D6": [58, 4],
    "D7": [14, 1],
    "D8": [3, 1],
    "D9": [10, 1],
    "D10": [159, 7],
    "D11": [196, 1],
    "D12": [174, 4],
    "D13": [161, 2],
    "D14": [70, 2],
    "D15": [51, 4],

}

def list_item_add(a,b,add_or_sub):
    if add_or_sub==1:
        c = []
        for i in range(len(a)):
            c1 = a[i] + b[i]
            c.append(c1)
        return c
    if add_or_sub==0:
        c = []
        for i in range(len(a)):
            c1 = a[i] - b[i]
            c.append(c1)
        return c

def list_multi(list_,rate):
    tempt_list=[]
    for i in list_:
        tempt_list.append(i*rate)
    return tempt_list



if __name__ == '__main__':

    #创建新表并插入csv文件中的输入
    #insert_csv_to_db("nutrition.csv")
    a=[1,2,3]
    b=[]
    b+=a
    print(b)


    #print(set(b))
    #print(a.__add__(b))
